//
//  TJUserPublishDataView.m
//  BaoDian
//
//  Created by mac on 2024/7/27.
//

#import "TJUserPublishDataView.h"
#import "TJUserPublishDataItem.h"

@implementation TJUserPublishDataView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        
        TJUserPublishDataItem *publishCountItem = [TJUserPublishDataItem addToView:self];
        publishCountItem.subTextLabel.text = @"发布次数";
        [publishCountItem mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.offset(0);
            make.width.mas_equalTo(self).dividedBy(4);
            make.top.bottom.offset(0);
        }];
        
        TJUserPublishDataItem *playerCountItem = [TJUserPublishDataItem addToView:self];
        playerCountItem.subTextLabel.text = @"播放量";
        [playerCountItem mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(publishCountItem.mas_right);
            make.width.top.bottom.equalTo(publishCountItem);
        }];
        
        TJUserPublishDataItem *likeCountItem = [TJUserPublishDataItem addToView:self];
        likeCountItem.subTextLabel.text = @"点赞数";
        [likeCountItem mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(playerCountItem.mas_right);
            make.width.top.bottom.equalTo(publishCountItem);
        }];
        
        TJUserPublishDataItem *commentCountItem = [TJUserPublishDataItem addToView:self];
        commentCountItem.subTextLabel.text = @"评论数";
        [commentCountItem mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(likeCountItem.mas_right);
            make.width.top.bottom.equalTo(publishCountItem);
        }];
        
        _publishCountItem = publishCountItem;
        _playerCountItem = playerCountItem;
        _likeCountItem = likeCountItem;
        _commentCountItem = commentCountItem;
    }
    return self;
}

@end


@implementation TJTaskDouYinDataView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        
        TJUserPublishDataItem *playerCountItem = [TJUserPublishDataItem addToView:self];
        playerCountItem.subTextLabel.text = @"播放量";
        [playerCountItem mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.offset(0);
            make.width.mas_equalTo(self).dividedBy(3);
            make.top.bottom.offset(0);
        }];
        
        TJUserPublishDataItem *likeCountItem = [TJUserPublishDataItem addToView:self];
        likeCountItem.subTextLabel.text = @"点赞数";
        [likeCountItem mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(playerCountItem.mas_right);
            make.width.top.bottom.equalTo(playerCountItem);
        }];
        
        TJUserPublishDataItem *commentCountItem = [TJUserPublishDataItem addToView:self];
        commentCountItem.subTextLabel.text = @"评论数";
        [commentCountItem mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(likeCountItem.mas_right);
            make.width.top.bottom.equalTo(playerCountItem);
        }];
        
        _playerCountItem = playerCountItem;
        _likeCountItem = likeCountItem;
        _commentCountItem = commentCountItem;
    }
    return self;
}

@end
